<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<script type="text/javascript">
		//判断是否选择了供应商
function checkChose(id){
			var len = $("#table1").find("input[type='checkbox'][data-ckb-id]:checked").length;
			if(len!=1){
				$.jBox.tip("请先勾选一个供应商！","${error}",{persistent:true,opacity:0});
			}else{
				$("#table1").find("input[type='checkbox'][data-ckb-id]:checked").each(function (){
					var id=$(this).attr("data-ckb-id");
					window.open("${contextPath}/biz/brand/supplierBank/"+id+"/edit","_self");
				});
			}
		}
	</script>
</head>
<body>
	<form:form id="supplierForm" modelAttribute="dict" method="post"
		class="form-inline" role="form">

		<div class="o-l-action">
			<div class="form-group">
				<input class="form-control" placeholder="供应商名称">
			</div>
			<button type="submit" class="btn btn-primary">查询</button>
			<a href="#" onclick="checkChose(${supplier.id})" class="btn btn-success btn-sm pull-right">添加银行信息</a>
		</div>
	</form:form>
	<tags:message content="${message}" />
	<table class="table table-striped table-hover o-l-table" id="table1">
		<thead>
			<tr>
				<th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
				<th>供应商中文名称</th>
				<th>供应商英文文名称</th>
				<th>组织机构代码</th>
				<th>供应商编号</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${supplierList}" var="supplier">
				<tr
					data-herf="${contextPath}/biz/brand/supplierBrand/${supplier.id}/view"
					data-target="_self">
					<td class="o-l-tab-ckb"><input type="checkbox"
						data-ckb-id="${supplier.id}"></td>
					<td>${supplier.cname}</td>
					<td>${supplier.ename}</td>
					<td>${supplier.organizationCode}</td>
					<td>${supplier.supplierNo}</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="o-l-page">
		<div class="col-sm-6">
			<ul class="pagination">
				<li class="disabled"><a href="javascript:">&#171; 上一页</a></li>
				<li class="disabled"><a href="#">1</a></li>
				<li class="disabled"><a href="#">下一页 &#187;</a></li>
			</ul>
		</div>
		<div class="col-sm-6">
			<span class="pull-right"> 到第<input
				class="form-control input-sm input-goto" type="text">页
				<button class="btn btn-sm btn-primary" role="button">go</button>
			</span>
		</div>
	</div>
	<script type="text/javascript" src="${staticPath}/js/list.js"></script>
</body>
</html>